<%-- 
    Document   : index
    Created on : 08/03/2014, 18:30:35
    Author     : jordan
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ page import="java.io.*,java.util.*" %>
<c:set var="primeiro" value=
    "<%=(
        session.getAttribute("acessou") == null ||
        session.getAttribute("acessou") != null &&
        session.getAttribute("acessou").equals("")
    )%>"/>
<%
    Integer hitsCount = (Integer)application.getAttribute("hitCounter");
    if( hitsCount ==null || hitsCount == 0 ){
       hitsCount = 1;
    }
%>
<c:if test="${primeiro}">    
    <c:set var="acessou" value="acessou" scope="session"/>
    <%
        hitsCount += 1;
    %>
</c:if>
<%
    application.setAttribute("hitCounter", hitsCount);
%>
<p>Você é o nosso <%= hitsCount%> &ordm; visitante</p>

<c:import url="menu.jsp" />
